import request from '~/utils/request';

export function login(data) {
    return request({
        url: '/User/Login',
        method: 'post',
        data,
    });
}

export function logout() {
    return request({
        url: '/User/Logout',
        method: 'get',
    });
}

export function getUserInfo() {
    return request({
        url: '/User/GetUserInfo',
        method: 'get',
    });
}

export function resetPassword(data) {
    return request({
        url: '/User/ResetPassword',
        method: 'post',
        data,
    });
}

export function sendVerifyCode(data) {
    return request({
        url: '/User/SendVerifyCode',
        method: 'post',
        data,
    });
}

export function regUserForOwner(data) {
    return request({
        url: '/User/RegUserForOwner',
        method: 'post',
        data,
    });
}

export function sendVerifyCodeForRegister(data) {
    return request({
        url: '/User/SendVerifyCodeForRegister',
        method: 'post',
        data,
    });
}

export function getUserLogList(data) {
    //获取用户日志列表
    return request({
        url: '/User/GetUserLogList',
        method: 'post',
        data,
    });
}

export function getUserList(data) {
    //获取用户列表
    return request({
        url: '/User/GetUserList',
        method: 'post',
        data,
    });
}

export function getManageUserList() {
    //获取管理层用户列表
    return request({
        url: '/User/GetManageUserList',
        method: 'get',
    });
}

export function getManageRoleList() {
    //获取管理层角色列表
    return request({
        url: '/User/GetManageRoleList',
        method: 'get',
    });
}

export function getRoleListKeyInfo(data) {
    //取角色列表
    return request({
        url: '/User/GetRoleListKeyInfo',
        method: 'get',
        data,
    });
}
export function getRoleListMaster(data) {
    //取角色列表--主角色
    return request({
        url: '/User/GetRoleListMaster',
        method: 'get',
        data,
    });
}
export function getRoleSelectList(data) {
    //取指定身份的角色列表
    return request({
        url: '/User/GetRoleSelectList',
        method: 'get',
        data,
    });
}
export function getRoleInfo(data) {
    //角色取单条记录
    return request({
        url: '/User/GetRoleInfo?roleid=' + data,
        method: 'get',
        data,
    });
}
export function saveRoleInfo(data) {
    //角色保存
    return request({
        url: '/User/SaveRoleInfo',
        method: 'post',
        data,
    });
}

export function getRightItemAll(data) {
    //取权限 项
    return request({
        url: '/User/GetRightItemAll',
        method: 'get',
        data,
    });
}
export function getRightItemOfRole(data) {
    //取权限 项--指定角色
    return request({
        url: '/User/GetRightItemOfRole?roleid=' + data,
        method: 'get',
        data,
    });
}

export function getRightIDListByRole(data) {
    //取权限ID值 通过roleid
    return request({
        url: '/User/GetRightIDListByRole?roleid=' + data,
        method: 'get',
        data,
    });
}
export function getRightCodeListByToken() {
    //取权限code值
    return request({
        url: '/User/GetRightCodeListByToken',
        method: 'get',
    });
}

export function saveUserRight(data) {
    //保存角色权限值
    return request({
        url: '/User/SaveUserRight',
        method: 'post',
        data,
    });
}

export function getRightValidCode(data) {
    //取权限项的有效编码
    return request({
        url: '/User/GetRightValidCode',
        method: 'post',
        data,
    });
}

export function judgeUserNameOnly(data) {
    //用户 判断用户名是否唯一
    return request({
        url: '/User/JudgeUserNameOnly?username=' + data,
        method: 'get',
        data,
    });
}

export function setStateNormal(data) {
    //用户 启用
    return request({
        url: '/User/SetStateNormal',
        method: 'post',
        data,
    });
}
export function setStateStop(data) {
    //用户 停用
    return request({
        url: '/User/SetStateStop',
        method: 'post',
        data,
    });
}
export function updateMobile(data) {
    //用户 修改手机
    return request({
        url: '/User/UpdateMobile',
        method: 'post',
        data,
    });
}
export function GetUserLogPagedList(data) {
    //操作日志   登录   查看商品
    return request({
        url: '/User/GetUserLogPagedList',
        method: 'post',
        data,
    });
}
export function GetUserLogdList(data) {
    //操作日志
    return request({
        url: '/User/GetUserLogdList',
        method: 'post',
        data,
    });
}
export function saveUserInfo(data) {
    //上传昵称
    return request({
        url: '/User/SaveUserInfo',
        method: 'post',
        data,
    });
}
export function sendCompanyVerifyCodeForRegister(data) {
    //开发注册   获取验证码接口 
    return request({
        url: '/User/SendCompanyVerifyCodeForRegister',
        method: 'post',
        data,
    });
}
export function sendBankVerifyCodeForRegister(data) {
    //银行注册   获取验证码接口 
    return request({
        url: '/User/SendBankVerifyCodeForRegister',
        method: 'post',
        data,
    });
}
export function sendAgentVerifyCodeForRegister(data) {
    //代理注册    获取验证码接口 
    return request({
        url: '/User/SendAgentVerifyCodeForRegister',
        method: 'post',
        data,
    });
}